package com.csweimei.rentmanagementtreasure.http.entity;

import com.csweimei.rentmanagementtreasure.utils.ValidateUtils;
import com.google.gson.annotations.SerializedName;

import java.util.List;

public class TabOneBean extends BaseResult{
    @SerializedName("data")
    private DataDTO data;

    public DataDTO getData() {
        return data;
    }

    public void setData(DataDTO data) {
        this.data = data;
    }

    public static class DataDTO {
        @SerializedName("be")
        private List<BeDTO> be;
        @SerializedName("due")
        private List<DueDTO> due;

        public List<BeDTO> getBe() {
            return be;
        }

        public void setBe(List<BeDTO> be) {
            this.be = be;
        }

        public List<DueDTO> getDue() {
            return due;
        }

        public void setDue(List<DueDTO> due) {
            this.due = due;
        }

        public static class BeDTO {
            @SerializedName("id")
            private int id;
            @SerializedName("Imgsrc")
            private String imgsrc;
            @SerializedName("quarters")
            private String quarters;
            @SerializedName("Address")
            private String address;
            @SerializedName("roomname")
            private String roomname;
            @SerializedName("rent")
            private String rent;
            @SerializedName("paytype")
            private String paytype;
            @SerializedName("staTime")
            private String staTime;
            @SerializedName("day")
            private String day;
            public String getTitle(){
                return quarters+roomname;
            }

            public String getUrl(){
                if (ValidateUtils.isNotEmptyString(imgsrc)){
                    if (imgsrc.contains(",")){
                        String[] strings = imgsrc.split(",");
                        return strings[0];
                    }
                }
                return "";
            }

            public String getUrlNum(){
                if (ValidateUtils.isNotEmptyString(imgsrc)){
                    if (imgsrc.contains(",")){
                        String[] strings = imgsrc.split(",");
                        return "+"+strings.length;
                    }
                }
                return "0";
            }


            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getImgsrc() {
                return imgsrc;
            }

            public void setImgsrc(String imgsrc) {
                this.imgsrc = imgsrc;
            }

            public String getQuarters() {
                return quarters;
            }

            public void setQuarters(String quarters) {
                this.quarters = quarters;
            }

            public String getAddress() {
                return address;
            }

            public void setAddress(String address) {
                this.address = address;
            }

            public String getRoomname() {
                return roomname;
            }

            public void setRoomname(String roomname) {
                this.roomname = roomname;
            }

            public String getRent() {
                return rent+"元/月";
            }

            public void setRent(String rent) {
                this.rent = rent;
            }

            public String getPaytype() {
                return paytype;
            }

            public void setPaytype(String paytype) {
                this.paytype = paytype;
            }

            public String getStaTime() {
                return ValidateUtils.getTimeFormYMD(staTime);
            }

            public void setStaTime(String staTime) {
                this.staTime = staTime;
            }

            public String getDay() {
                return day;
            }

            public void setDay(String day) {
                this.day = day;
            }
        }

        public static class DueDTO {
            @SerializedName("id")
            private int id;
            @SerializedName("Imgsrc")
            private String imgsrc;
            @SerializedName("quarters")
            private String quarters;
            @SerializedName("Address")
            private String address;
            @SerializedName("roomname")
            private String roomname;
            @SerializedName("rent")
            private String rent;
            @SerializedName("paytype")
            private String paytype;
            @SerializedName("staTime")
            private String staTime;
            @SerializedName("day")
            private String day;

            public String getTitle(){
                return quarters+roomname;
            }

            public String getUrl(){
                if (ValidateUtils.isNotEmptyString(imgsrc)){
                    if (imgsrc.contains(",")){
                        String[] strings = imgsrc.split(",");
                        return strings[0];
                    }
                }
                return "";
            }

            public String getUrlNum(){
                if (ValidateUtils.isNotEmptyString(imgsrc)){
                    if (imgsrc.contains(",")){
                        String[] strings = imgsrc.split(",");
                        return "+"+strings.length;
                    }
                }
                return "0";
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getImgsrc() {
                return imgsrc;
            }

            public void setImgsrc(String imgsrc) {
                this.imgsrc = imgsrc;
            }

            public String getQuarters() {
                return quarters;
            }

            public void setQuarters(String quarters) {
                this.quarters = quarters;
            }

            public String getAddress() {
                return address;
            }

            public void setAddress(String address) {
                this.address = address;
            }

            public String getRoomname() {
                return roomname;
            }

            public void setRoomname(String roomname) {
                this.roomname = roomname;
            }

            public String getRent() {
                return rent+"元/月";
            }

            public void setRent(String rent) {
                this.rent = rent;
            }

            public String getPaytype() {
                return paytype;
            }

            public void setPaytype(String paytype) {
                this.paytype = paytype;
            }

            public String getStaTime() {
                return ValidateUtils.getTimeFormYMD(staTime);
            }

            public void setStaTime(String staTime) {
                this.staTime = staTime;
            }

            public String getDay() {
                return day;
            }

            public void setDay(String day) {
                this.day = day;
            }
        }
    }
}
